//
//  ZLbaseNavigationController.swift
//  新浪微博
//
//  Created by 朱玉龙 on 9/22/16.
//  Copyright © 2016 朱玉龙. All rights reserved.
//

import UIKit

class ZLBaseNavigationController: UINavigationController {

    override func viewDidLoad() {
        super.viewDidLoad()
        
        
    }
    
    override func pushViewController(_ viewController: UIViewController, animated: Bool) {
    
    let count = self.childViewControllers.count
    
        if count > 0 {
            
            viewController.navigationItem.leftBarButtonItem = UIBarButtonItem.init(title: "返回", imageName: "navigationbar_back_withtext", target: self, action: #selector(pop))
        }
        

        super.pushViewController(viewController, animated: true)
        
    }

func pop() {
    
    popViewController(animated: true)
}

}
